//
//  ConfuseResource.m
//  ConfuseTooles
//
//  Created by vincent on 2018/5/7.
//  Copyright © 2018年 vincent. All rights reserved.
//

#import "ConfuseResource.h"
#import "FileUtils.h"
#import "RandomUtils.h"

@implementation ConfuseResource

+(void) createSmallFile:(NSString *)rootPath fileNum:(int) fileNum {
//  NSString *filePath = [[FileUtils getCurrPath] stringByAppendingPathComponent:@"test"];
//  NSData *data = [@"testtest" dataUsingEncoding:NSUTF8StringEncoding];
//  [FileUtils createFile:filePath content:data];
  
  NSString *path = [[FileUtils getCurrPath] stringByAppendingPathComponent:rootPath];
  for (int i=0;i<fileNum;i++) {
    NSString *content = [RandomUtils getRandomStr:500 with:nil];
    NSString *filePath = [RandomUtils getRandomFilePath:path maxLevel:5];
    NSString *fileName = [RandomUtils getRandomStr:20 with:nil];
    NSString *rPaht = [NSString stringWithFormat:@"%@/%@.js",filePath,fileName];
    
    [FileUtils createFile:rPaht content:content];
    
  }
}

@end
